<%--
  Created by IntelliJ IDEA.
  User: 泪雨痕
  Date: 2024/8/28
  Time: 15:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<link rel="stylesheet" href="${path}/static/manage/css/MsgStyle.css">
<html>
<head>
    <title>Title</title>
</head>
<body>

<script type="text/javascript" src="${path}/static/manage/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="${path}/static/manage/js/showParking.js"></script>
<script type="text/javascript">
    $(function (){
        $(".del").click(deleteCar);
    });
    function deleteCar()
    {

        var id = $(this).attr("id");

        $.ajax({
            url:"/project/manage/deletecar",
            type:"post",
            data:{id:id},
            success:function (mes){
                $(this).parent().parent().remove();
            }.bind(this)
        });
    }
</script>
<%--查出所有的车辆信息--%>
<div class="div_container">
    <table style="margin: 50px auto;" id="pageListTable">
        <thead>
        <tr>
            <th>用户姓名</th>
            <th>车牌号</th>
            <th>操作</th>
        </tr>
        </thead>
    <tbody id="pageListTableBody">
    <c:forEach items="${requestScope.carList}" var="car">
        <tr>
            <td>${car.user.userName}</td>
            <td>${car.license}</td>
            <td><a id="${car.license}" class="del" href="javascript:void(0);" >删除</a></td>
        </tr>
    </c:forEach>
    </tbody>
  <tfoot>
  <tr><td colspan="3">
      <div id="pages" style="float: right;margin-right: 20px;">
          <span id="spanFirst">首页</span>
          <span id="spanPre">上一页</span>
          <span id="spanNext">下一页</span>
          <span id="spanLast">尾页</span>
          第<strong id="spanPageNum"></strong>页/共
          <strong id="spanTotalPage"></strong>页
      </div>
  </td>
  </tr>
  </tfoot>
    </table>
</div>



</body>
</html>
